#include <string>

class Task
{
public:
    Task() {}
    Task(int x,int y,char oper)
    :_x(x)
    ,_y(y)
    ,_oper(oper)
    {}

    void operator()()
    {
        compute();
    }

    void compute()
    {
        switch(_oper)
        {
            case '+':
            {
                _result = _x+_y;
                _exitret = 0;
                break;
            }
            case '-':
            {
                _result = _x-_y;
                _exitret = 0;
                break;
            }
            case '*':
            {
                _result = _x*_y;
                _exitret = 0;
                break;
            }
            case '/':
            {
                if(_y == 0) 
                {
                    _exitret = -1;
                    _result = 0;
                }
                else
                {
                    _result = _x/_y;
                    _exitret = 0;
                }
                break;
            }
            case '%':
            {
                if(_y == 0) 
                {
                    _exitret = -2;
                    _result = 0;
                }
                else
                {
                    _result = _x%_y;
                    _exitret = 0;
                }
                break;
            }
            default: break;
        }
    }

    std::string outcome() //计算结果
    {
        return std::to_string(_result) + "(" + std::to_string(_exitret) + ")";
    }

    std::string calcu() //计算式
    {
        return std::to_string(_x) + _oper + std::to_string(_y) + "=";
    }

    ~Task() {}
private:
    int _x; //计算值
    int _y;
    char _oper; //运算符

    int _result; //计算结果
    int _exitret; //返回值
};